package zjitc;

import javax.servlet.*;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * Created by Administrator on 2017/9/21.
 */
public class Ascrvlet implements Servlet {
    private ServletConfig servletConfig=null;


    @Override
    public void init(ServletConfig servletConfig) throws ServletException {
        this.servletConfig=servletConfig;
        System.out.println("sheng");
    }

    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    @Override
    public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
        String value=this.servletConfig.getInitParameter("Ecodas");
        PrintWriter out=servletResponse.getWriter();
        out.write("<h1>"+value+"</h1>");
        System.out.println("lui");
        ServletContext context =this.servletConfig.getServletContext();
        context.setAttribute("name","shangan");
    }

    @Override
    public String getServletInfo() {
        return null;
    }

    @Override
    public void destroy() {
        System.out.println("sile");

    }
}
